<template>
	<view>
		<view class="tui-actionsheet" :class="[show ? 'tui-actionsheet-show' : '']" >
			<view class="regional-selection">
				<view class="specs">
				  <view class="specs-top pt-30 pl-5">
				     <view>选择收货地址</view>
					 <view class="flex cancel-button">
					 	<u-icon name="close-circle" color="#999999" size="22" @click="handleClickMask()"></u-icon>					
					 </view>  
				  </view>
				  
				    
				  <block v-for="(item,index) in addresslist" :key="index">
				    <view class="mb-10"  >
				        <view class='flex border-radius border-b pt-30 pb-30 justify-between align-center text-center mr-20' @click="handleOperate(item)">
						    <view class="flex">
						    	<radio color="#36B3E9" :checked="item.checked"></radio> 						    
								<view class="flex mr-30" style="flex-direction: column;position: relative;">							
										<view class='flex align-center cell address-title'>
											<view style="display:flex">
												<text class="">{{item.realname}}</text>
											</view>							   
											<text class="">{{item.phone}}</text>
											<view class="default_img" v-if="item.is_default==1">
											  <view class="default_text">
												默认
											  </view>				   								
											</view>
										</view>							
										<view class="flex  mt-10 address-info">{{item.province}}{{item.city}}{{item.region}}{{item.address}}</view>				            
								  </view>
						  </view>
				          <view slot="footer" @click="eidtOperate(item)">
							  <image src="../../static/resource/address_edit.png" style="width: 31rpx; height: 31rpx;"></image>
				          </view>
				        </view>
				    </view>                
				    </block> 					
					<view class="ml-15" @click="bindAddress()">				
						<button class="about-button-alipay" style="background:#fff;border-radius: 62rpx;border: 1rpx solid #36B3E9;color: #36B3E9;;height: 80rpx;text-align: center;line-height: 81rpx;">
								<u-icon name="plus"  color="#36B3E9 ;"></u-icon>
								<view class=" ml-10">
									新增地址
								</view>
						</button>
					</view>		
				</view>
			</view>
		</view>
		<!-- 遮罩层 -->
		<view class="tui-actionsheet-mask"  :class="[show ? 'tui-mask-show' : '']"  @tap="handleClickMask"></view>
	</view>
</template>
 
<script>
export default {
  // name: "tuiActionsheet",
  props: {
    //点击遮罩 是否可关闭
    maskClosable: {
      type: Boolean,
      default: true,
    },
    //显示操作菜单
    show: {
      type: Boolean,
      default: false,
    },
	orderType:{
		ype: String
	}
  },
  data(){
	  return {
		  addresslist:[]
	  }
  },
methods:  {
   
    handleClickMask() {
		 this.$emit("chooseCancel",false);
    },
	
	//地址信息
	showSpecs(events){
		this.addresslist=events.list
	},
	//选中地址
	handleOperate(events){
		this.$emit('chooseaddess',events)
	},
	//跳转地址
	bindAddress(){
		uni.navigateTo({
			url:"/pages/pagesuser/address/add-edit/index"
		})
	},
	//编辑地址
	eidtOperate(item){
		uni.navigateTo({
			url:"/pages/pagesuser/address/add-edit/index?type=u&item="+JSON.stringify(item)
		})
	}
    
   
  },
};
</script>
 
<style scoped lang="less">
	.default_text{
		display: flex;
		
		font-size: 22rpx;
		color: #FFFFFF;
		padding-left: 20rpx;
		color: #fff;
		padding-left: 5rpx;
	}
	.address_select{
		position: absolute;
		top:0rpx;
		left: 20rpx;
	}
	
	.default_img{
		display: flex;
		background: #36B3E9;
		border-radius: 4rpx !important;
		align-items: center;
		text-align: center;
		justify-content: center;
	}
	
	
	
	.about-button-alipay{
		display: flex;
		justify-content: center;
		width: 620rpx;
		font-size: 28rpx;
		color: #031F37;
		border-radius: 40rpx;
		
	}
	
	button::after {
	    border: none;
	}
	
	.about-button:active{
	  opacity: 0.5;
	}
	.button-address{
		width: 160rpx;
		
	}
 .cancel-button{
	 position: absolute;
	 right: 20rpx;
 }
.address-info{
	font-weight: 400;
	font-size: 28rpx;
	color: #999999;
	margin-top: 10rpx;
	margin-left: 20rpx;
}
.address-title{
	font-weight: 400;
	font-size: 30rpx;
	color: #000000;
	line-height: 32rpx;
    margin-bottom: -10rpx !important;
}
.tui-actionsheet {
  width: 100%;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  visibility: hidden;
  transform: translate3d(0, 100%, 0);
  transform-origin: center;
  transition: all 0.3s ease-in-out;
  // background: #eaeaec;
  min-height: 100rpx;
}
 
.tui-actionsheet-show {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}
.regional-selection {
    text-align: center;
  // height: 400rpx;
  background: #fff;
   border-radius: 16rpx;
   padding-bottom: 110rpx;
}
.tui-actionsheet-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9996;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}
 
.tui-mask-show {
  opacity: 1;
  visibility: visible;
}

/* component/specs/index.wxss */
.specs{
  padding: 0 20rpx;
  align-items: flex-end;

}

.productNameText{color:rgb(32,27,27);font-size:35rpx;text-overflow:ellipsis;z-index:-1;display:-webkit-box;word-break:break-all;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;}

.specs-top{
  display: flex;
  flex-direction: row;
  justify-content:center;
  align-items: center;
  text-align: center;
  padding-bottom: 20rpx;
  padding-top: 25rpx;
  border-bottom: 1rpx solid rgb(240, 235, 235);
  font-weight: 600;
  font-size: 35rpx;
  color: #4D4D4D;
}
.specs-image {
  width: 152rpx !important;
  height: 152rpx !important;
  background: rgba(0, 0, 0, 0);
  border: 1rpx solid #E5E9E8;
  border-radius: 16rpx;
}

.specs-title {
  font-size: 30rpx;
  color: #333333;
  opacity: 1;
  margin: 30rpx 0 20rpx 0;
}

.specs-cell{
  display: flex;
  flex-wrap: wrap;
}

.specs-name {
  color: #888888;
  border: 1rpx solid #888888;
  border-radius: 10rpx;
  padding: 15rpx 20rpx;
  font-size: 28rpx;
  margin-right: 15rpx;
  margin-bottom: 20rpx;
}

.specs-goods-name {
  font-size: 32rpx;
  line-height: 40rpx;
  margin-bottom: 10rpx;
}

.specs-goods {
  font-size: 28rpx;
  line-height: 40rpx;
  color: gray;
  margin-bottom: 20rpx;
}
.specs_name{
  margin-top: 40rpx;
  width: 62%;
  border-bottom: 1rpx solid rgb(240, 235, 235);
  
}

.specs-price {
  font-size: 38rpx;
  color: #EE4D52;
  margin-left: -5rpx;
}

.specs-num {
  font-size: 28rpx;
  color: #999999;
}

.submit-btn-left {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  min-width: 240rpx;
  width: 100%;
  height: 76rpx;
  opacity: 1;
  border-radius: 38rpx 0 0 38rpx;
}

.submit-btn-right {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  min-width: 240rpx;
  width: 100%;
  height: 76rpx;
  opacity: 1;
  /* border-radius: 0 38rpx 38rpx 0;
  margin-top: 2rpx; */
}
.specs{
 
    margin-bottom: -44rpx;
    
}
.main-bottom{
  display: flex;
  flex-direction:column;
}
</style>